package com.googlecode.horncomb.core.id.generator;

import java.util.UUID;

/**
 * JDK的UUID生成器
 * @author Daniel
 */
public class JdkUUIDGenerator implements IdGenerator<String> {

	/**
	 * 自动生成指定个数的UUID
	 * @param args
	 *            生成的数量
	 */
	public static void main(String[] args) {
		int time = 1;
		if (args != null && args.length > 0) {
			time = Integer.valueOf(args[0]);
		}
		for (int i = 0; i < time; i++) {
			System.out.println(new JdkUUIDGenerator().generateId());
		}
	}

	/**
	 * @see com.googlecode.horncomb.core.id.generator.IdGenerator#generateId()
	 */
	public String generateId() {
		return UUID.randomUUID().toString();
	}
}
